package com.weichai.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.weichai.dao.UserDao;
import com.weichai.wc_commons.entity.User;

@Service
public class UserService {
	
	@Autowired
	private UserDao userDao;

	public User findByNameAndPassowrd(String name, String password) {
		// 查询符合条件的用户
		List<User> users = userDao.findByNameAndPassword(name, password);
		return users.size() == 1 ? users.get(0) : new User();
	}
}
